/**   
  * @Title: DefaultNodeComparator.java 
  * @package com.sysmanage.tree.support 
  * @Description: 
  * @author zhangfeng 13940488705@163.com 
  * @date 2011-8-9 下午04:49:46 
  * @version V1.0   
  */

package com.sysmanage.tree.support;

import com.sysmanage.tree.Node;

/** 
 * @ClassName: DefaultNodeComparator 
 * @Description: 采用节点文本进行排序
 * @author zhangfeng 13940488705@163.com
 * @date 2011-8-9 下午04:49:46 
 *  
 */
public class WebTreeNodeComparator extends AbstractNodeComparator {

	protected Comparable getComparableProperty(Node pNode) {
		if ( pNode instanceof WebTreeNode == false){
			throw new IllegalArgumentException("node type is error, should be WebNode!");
		}
		WebTreeNode webTreeNode = (WebTreeNode)pNode;
		Integer nodId = null;
		if(webTreeNode.getId()!=null)
		{
			try{
				nodId = Integer.parseInt(webTreeNode.getId());
			}catch(Exception ex)
			{
			}
		}
		return nodId;
	}

}